﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Web.Core;
using Web.Core.Objects;

public partial class include_contact : System.Web.UI.UserControl
{
    int result = -2;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Session["Membership"] != null)
            this.txtMail.Text += " (" + Resources.Lang.Members + ")";
        Contact c = new Contact(0, this.txtName.Text, this.contact_title.Text, this.txtMail.Text, this.txaInquiry.Text, DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + DateTime.Now.Year);
        result = Contacts.InsertContact(c);
        if (result > -1)
        {
            this.MsgClient.InnerHtml = "<script language='javascript'>window.alert(" + '"' + Resources.Lang.ContactSuccess + '"' + ");</script>";
           // InitControls();
        }
        else if (result == -1)
            this.MsgClient.InnerHtml = "<script language='javascript'>window.alert(" + '"' + Resources.Lang.Failure + '"' + ");</script>"; 
    }
}
